/*========================================================================
#   FileName: control.c
#     Author: lwd
#      Email: lwd_xinghuo@126.com
#   HomePage: 
# LastChange: 2013-04-18 15:38:24
========================================================================*/
//#include <stdio.h>
#include <pthread.h>

static pthread_mutex_t promt = PTHREAD_MUTEX_INITIALIZER;

int P()
{
	//printf("P\n");
	return pthread_mutex_lock(&promt);
}

int V()
{
	//printf("V\n");
	return pthread_mutex_unlock(&promt);
}

int init_P_V()
{
	return P()||V();
}
